{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "LayerChart with Bar and Tick\n",
    "----------------------------\n",
    "This example shows how to layer two charts on top of one another.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "import altair as alt\n",
    "alt.data_transformers.enable('json')\n",
    "import pandas as pd\n",
    "\n",
    "data = pd.DataFrame({\n",
    "    'project': ['a', 'b', 'c', 'd', 'e', 'f', 'g'],\n",
    "    'score': [25, 57, 23, 19, 8, 47, 8],\n",
    "    'goal': [25, 47, 30, 27, 38, 19, 4]}\n",
    ")\n",
    "\n",
    "a = alt.Chart().mark_bar().encode(\n",
    "    x='project',\n",
    "    y='score'\n",
    ")\n",
    "\n",
    "b = alt.Chart().mark_tick(\n",
    "    color='red',\n",
    ").encode(\n",
    "    x='project',\n",
    "    y='goal'\n",
    ")\n",
    "\n",
    "alt.layer(a, b).properties(\n",
    "    data=data\n",
    ").configure_tick(\n",
    "    thickness=2,\n",
    "    bandSize=35  # controls the width of the tick\n",
    ").configure_scale(\n",
    "    rangeStep=40  # controls the width of the bar\n",
    ")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "env": {},
   "interrupt_mode": "signal",
   "language": "python",
   "metadata": {},
   "name": "python3"
  },
  "language": "python"
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
